package 面向对象;

public class Student {
    public static void main(String[] args) {
        //这一步只是声明studentTest类创建20个对象
      StudentTest stu[] = new StudentTest[20];
        for (int i = 0; i < stu.length; i++) {
            //这一步是赋值语句
             stu[i] = new StudentTest();
             stu[i].number=i+1;
             stu[i].state=(int)(Math.random()*(6-1+1)+1);
        }
    }
}
class StudentTest{
    public int number;//学号
    public int state;//年级
    public int score;//成绩

}

